// banner图
$(document).ready(function () {
    $('.banner-box').owlCarousel({
        items: 1,
        loop: true,
        autoplay: true,
        autoplayTimeout: 3000,
        autoplayHoverPause: true,
        nav: true,
        dots: true,
        navText: [
            `<img src="./images/id-prev.png">`,
            `<img src="./images/id-next.png">`,
        ],
        // navContainer: '#customNav',
    })

    // 业务内容跳转js
    $('#ywContent li').click(function () {
        window.location.href = './about.html#about2'
    })
    // 最新资讯切换
    $('#newList li').click(function () {
        $(this).siblings().find('.item-tab').removeClass('tab-active')
        $(this).find('.item-tab').addClass('tab-active')

    })

    $('.search-btn').click(function() {
        window.location.href = './qa.html'
    })

    $('.m-dt').click(function () {
        window.location.href = './college-school.html'
    })

    // 地图点 1. 创建点集合 固定区域（亚利桑那州）
    $('.index4-bg').append(`<div class="point-box"></div>`)

    // 模拟后台动态数据
    for (let i = 1 ; i < 8; i++) {
        $('.point-box').append(`
            <div class="mock-point" style="top:${Math.random(0, 1.5)}rem; left: ${Math.random(0, 2.5)}rem">
                <div class="mock-popover"><a href="./college-article.html">奥马中学奥马中学奥马中学${i}</a></div>
            </div>
            `)
    }
    $('.mock-point').mouseenter(function () {
        $(this).find('.mock-popover').css({display: 'block', 'z-index': 999})
    })
    $('.mock-point').mouseleave(function () {
        $(this).find('.mock-popover').css({display: 'none', 'z-index': 1})
    })

})